#ifndef _RASTER_CHANNEL_357DA398_53E8_456F_8E4F_FB036106E1BC_
#define _RASTER_CHANNEL_357DA398_53E8_456F_8E4F_FB036106E1BC_
#include <map>
#include "work_channel.h"
#include "proxy.h"
#include "common/message.h"
#include "common/download.h"

class DownloadChannel : public WorkChannelImpl<DownloadChannel>, public IDownloadProxy {
private:
	struct IORequest;
public:
	DownloadChannel();
	std::wstring GetLaunchFile() const;

private:
  // IDownloadProxy method
  virtual void SetNotifyDelegate(NotifyDelegate* delegate) override;
  virtual void AddUrlRequest(unsigned int symbol, const UrlRequestData* data) override;
  virtual void CancelUrlRequest(unsigned int symbol) override;
	
	// IPC::Listener
	virtual bool OnMessageReceived(const IPC::Message& message);
  // 请求的回复处理
  void OnRequestResponse(unsigned int symbol, MSG_Response_Param param);
  // 请求的进度处理
  void OnRequestProgress(unsigned int symbol, MSG_Progress_Param param);
  // 请求完成处理
  void OnRequestFinished(unsigned int symbol, MSG_Finished_Param param);

private:
  NotifyDelegate* notify_delegate_;
};

#endif//_RASTER_CHANNEL_357DA398_53E8_456F_8E4F_FB036106E1BC_
